<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

class TopographicMap extends AppModel {

    var $name = "TopographicMap";
    var $actsAs = array('Logable' => array(
            'userModel' => 'User',
            'userKey' => 'user_id',
            'change' => 'full', // options are 'list' or 'full'
            'description_ids' => TRUE // options are TRUE or FALSE
            ));
    var $belongsTo = array('Property', 'Departament', 'City');
    var $hasMany = array(
        'TopographicArea' => array(
            'model' => 'TopographicArea',
            'dependent' => true
        ),
        'InitialEvaluationAnnex' => array(
            'model' => 'InitialEvaluationAnnex',
            'dependent' => false
        ),
        'FinalEvaluationAnnex' => array(
            'model' => 'InitialEvaluationAnnex',
            'dependent' => false
        ),
        'TopographicMapReview' => array(
            'model' => 'TopographicMapReview',
            'dependent' => false
        )
    );
    var $validate = array(
        'city_id' => array(
            'notEmpty' => array(
                'rule' => 'notEmpty',
                'message' => 'Debe seleccionar una ciudad, para ello vuelva a seleccionar un departamento.'
            ),
        ),
        'area' => array(
            'rule' => 'numeric', 'required' => true, 'message' => 'Este campo es obligatorio. Debe ser un número.'
        ),
    );

}

?>
